package com.brother.realtime.config;

import java.text.DecimalFormat;


public class OverSpeedConfig implements Config {
	
	public static final String ENABLE = "123456J1,"; 
	public static final String DISABLE = "123456J0"; 
	
	private String action;
	

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	DecimalFormat nf = new DecimalFormat("000");
	@Override
	public byte[] getData() {
		if(action.equals(ENABLE)){
			return (ENABLE + nf.format(speed)).getBytes();
		}else{
			return DISABLE.getBytes();
		}
	}
	
	private float speed;

	public float getSpeed() {
		return speed;
	}

	public void setSpeed(float speed) {
		this.speed = speed;
	}

}
